package com.abyss.bprecord;

import android.app.Application;
import android.database.sqlite.SQLiteDatabase;

import com.abyss.greendaodemo.db.DaoMaster;
import com.abyss.greendaodemo.db.DaoMaster.DevOpenHelper;
import com.abyss.greendaodemo.db.DaoSession;

public class MyApp extends Application {
    public DaoSession getDaoSession() {
        return daoSession;
    }

    private DaoSession daoSession;

    @Override
    public void onCreate() {
        super.onCreate();
        DevOpenHelper devOpenHelper = new DevOpenHelper(this, "bp.db");
        SQLiteDatabase database = devOpenHelper.getWritableDatabase();
        DaoMaster daoMaster = new DaoMaster(database);
        daoSession = daoMaster.newSession();
    }
}
